import http from '../http'
/**新增分类 */
export function categories (data) {
  return http({
    url: "/categories",
    method: "post",
    data: data
  })
}
/**分类列表 */
export function list () {
  return http({
    url: "/categories/list",
    method: "get",
  })
}
/**点击编辑 */
export function edit (params) {
  return http({
    url: "/categories/edit",
    method: "get",
    params: { id: params }
  })
}
/**点击编辑后保存 */
export function save (data) {
  return http({
    url: "/categories/save",
    method: "post",
    data: data
  })
}
/**删除 */
export function remove (data) {
  return http({
    url: "/categories/remove",
    method: "post",
    data: { id: data }
  })
}
/**上传图片 */
export function upload (data) {
  return http({
    url: "/upload",
    method: "post",
    data: data
  })
}

/**用户注册 */
export function register (data) {
  return http({
    url: "/register",
    method: "post",
    data: data
  })
}

/**用户登录 */
export function login (data) {
  return http({
    url: "/login",
    method: "post",
    data: data
  })
}